"""
Pydantic V2 的错误类型

References:
    https://docs.pydantic.dev/2.10/errors/validation_errors/
"""

from typing import (
    Dict,
    Type,
)

from devtools import debug
from pydantic_core import PydanticCustomError

from utils.validator_utils.pydantic_x.errors.base import PydanticErrorBase


class PydanticV2CustomErrorBase(PydanticCustomError, PydanticErrorBase):
    """ Pydantic V2 自定义错误基类 """

    def __init__(self, *args, **kwargs) -> None:
        debug(*args, **kwargs)
        super().__init__(
            self,
            error_type=self.code,
            message_template=self.message_template,
            context=kwargs,
            *args, **kwargs,
        )


def get_v2_custom_code_2_error() -> Dict[str, Type[PydanticErrorBase]]:
    """ 获取 Pydantic V2 自定义错误编号 - 错误类 映射 """

    return {
        cls.code: cls
        for cls in PydanticV2CustomErrorBase.__subclasses__()
        if cls is not PydanticV2CustomErrorBase
    }


class PydanticV2BuiltInError:
    """ Pydantic V2 内置错误 """

    class ArgumentsTypeError(PydanticErrorBase):
        """
        参数类型错误

        This error is raised when an object that would be passed as arguments to a function during validation is
        not a `tuple`, `list`, or `dict`. Because `NamedTuple` uses function calls in its implementation, that
        is one way to produce this error:

        Translation:
            当在验证过程中，一个本应作为函数参数传递的对象不是元组（tuple）、列表（list）或字典（dict）时，就会引发此错误。
            因为 NamedTuple 在其实现中使用了函数调用，所以这是产生此错误的一种常见情况：

        Examples:
            >>> from typing import NamedTuple
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class MyNamedTuple(NamedTuple):
            >>>     x: int
            >>>
            >>> class MyModel(BaseModel):
            >>>     field: MyNamedTuple
            >>>
            >>> try:
            >>>     MyModel.model_validate({"field": "invalid"})
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "arguments_type"

        References:
            - https://errors.pydantic.dev/2.10/v/arguments_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#arguments_type
        """

        code = "arguments_type"
        msg_template = "Input should be a valid dictionary or instance of {class_name}"
        msg_template_zh_cn = "输入应为有效的字典或 {class_name} 的实例"

    class AssertionError(PydanticErrorBase):
        """
        断言错误

        This error is raised when a failing `assert` statement is encountered during validation:

        Translation:
            当验证过程中遇到失败的 assert 断言语句时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError, field_validator
            >>>
            >>> class Model(BaseModel):
            >>>     x: int
            >>>
            >>>     @field_validator("x")
            >>>     @classmethod
            >>>     def force_x_positive(cls, v):
            >>>         assert v > 0
            >>>         return v
            >>>
            >>> try:
            >>>     Model(x=-1)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "assertion_error"

        References:
            - https://errors.pydantic.dev/2.10/v/assertion_error
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#assertion_error
        """

        code = "assertion_error"
        msg_template = "Assertion failed"
        msg_template_zh_cn = "断言失败"

    class BoolParsingError(PydanticErrorBase):
        """
        布尔值解析错误

        This error is raised when the input value is a string that is not valid for coercion to a boolean:

        Translation:
            当输入值是无法转换为布尔值的字符串时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: bool
            >>>
            >>> Model(x="true")  # OK
            >>>
            >>> try:
            >>>     Model(x="test")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "bool_parsing"

        References:
            - https://errors.pydantic.dev/2.10/v/bool_parsing
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#bool_parsing
        """

        code = "bool_parsing"
        msg_template = "Input should be a valid boolean, unable to interpret input"
        msg_template_zh_cn = "输入应为有效的布尔值，无法解析输入内容"

    class BoolTypeError(PydanticErrorBase):
        """
        布尔值类型错误

        This error is raised when the input value's type is not valid for a `bool` field:

        Translation:
            当输入值的类型不适用于 `bool` 字段时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: bool
            >>>
            >>> try:
            >>>     Model(x=None)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "bool_type"

        References:
            - https://errors.pydantic.dev/2.10/v/bool_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#bool_type
        """

        code = "bool_type"
        msg_template = "Input should be a valid boolean"
        msg_template_zh_cn = "输入应为有效的布尔值"

    class BytesInvalidEncodingError(PydanticErrorBase):
        """
        字节编码无效错误

        This error is raised when a `bytes` value is invalid under the configured encoding.
        In the following example, `b'a'` is invalid hex (odd number of digits).

        Translation:
            当 bytes 值在配置的编码下无效时，会引发此错误。在以下示例中，b'a' 是无效的十六进制（数字个数为奇数）。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: bytes
            >>>     model_config = {"val_json_bytes": "hex"}
            >>>
            >>> try:
            >>>     Model(x=b'a')  # 实际运行无报错，换成下面那个才报错
            >>>     Model.model_validate_json('{"x": "zz"}')
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "bytes_invalid_encoding"

        References:
            - https://errors.pydantic.dev/2.10/v/bytes_invalid_encoding
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#bytes_invalid_encoding
        """

        code = "bytes_invalid_encoding"
        msg_template = "Data should be valid {encoding}"
        msg_template_zh_cn = "数据应为有效的 {encoding}"

    class BytesTooLongError(PydanticErrorBase):
        """
        字节长度过长错误

        This error is raised when the length of a `bytes` value is greater than the field's `max_length` constraint:

        Translation:
            当 `bytes` 值的长度超过字段的 `max_length` 限制时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: bytes = Field(max_length=3)
            >>>
            >>> try:
            >>>     Model(x=b"test")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "bytes_too_long"

        References:
            - https://errors.pydantic.dev/2.10/v/bytes_too_long
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#bytes_too_long
        """

        code = "bytes_too_long"
        msg_template = "Data should have at most {max_length} bytes"
        msg_template_zh_cn = "数据最多应包含 {max_length} 个字节"

    class BytesTooShortError(PydanticErrorBase):
        """
        字节长度过短错误

        This error is raised when the length of a `bytes` value is less than the field's `min_length` constraint:

        Translation:
            当 `bytes` 值的长度小于字段的 `min_length` 限制时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: bytes = Field(min_length=3)
            >>>
            >>> try:
            >>>     Model(x=b"t")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "bytes_too_short"

        References:
            - https://errors.pydantic.dev/2.10/v/bytes_too_short
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#bytes_too_short
        """

        code = "bytes_too_short"
        msg_template = "Data should have at least {min_length} bytes"
        msg_template_zh_cn = "数据至少应包含 {min_length} 个字节"

    class BytesTypeError(PydanticErrorBase):
        """
        字节类型错误

        This error is raised when the input value's type is not valid for a `bytes` field:

        Translation:
            当输入值的类型不适用于 `bytes` 字段时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: bytes
            >>>
            >>> try:
            >>>     Model(x=123)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "bytes_type"

        References:
            - https://errors.pydantic.dev/2.10/v/bytes_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#bytes_type
        """

        code = "bytes_type"
        msg_template = "Input should be a valid bytes"
        msg_template_zh_cn = "输入应为有效的字节数据"

    class CallableTypeError(PydanticErrorBase):
        """
        可调用对象类型错误

        This error is raised when the input value is not valid as a `Callable`:

        Translation:
            当输入值不是有效的`Callable`（可调用对象）时，会引发此错误。

        Examples:
            >>> from typing import Any, Callable
            >>> from pydantic import BaseModel, ImportString, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: ImportString[Callable[[Any], Any]]
            >>>
            >>> Model(x="math:cos")  # OK
            >>>
            >>> try:
            >>>     Model(x="os.path")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "callable_type"

        References:
            - https://errors.pydantic.dev/2.10/v/callable_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#callable_type
        """

        code = "callable_type"
        msg_template = "Input should be callable"
        msg_template_zh_cn = "输入应为可调用对象"

    class ComplexStrParsingError(PydanticErrorBase):
        """
        复数字符串解析错误

        This error is raised when the input value is a string but cannot be parsed as a complex number
        because it does not follow the rule in Python:

        Translation:
            当输入值为字符串但无法按照 Python 规则解析为复数时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     num: complex
            >>>
            >>> try:
            >>>     # Complex numbers in json are expected to be valid complex strings.
            >>>     # This value `abc` is not a valid complex string.
            >>>     Model.model_validate_json("{'num': 'abc'}")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "complex_str_parsing"

        References:
            - https://errors.pydantic.dev/2.10/v/complex_str_parsing
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#complex_str_parsing
        """

        code = "complex_str_parsing"
        msg_template = (
            "Input should be a valid complex string following the rules "
            "at https://docs.python.org/3/library/functions.html#complex"
        )
        msg_template_zh_cn = "输入应为符合 Python 复数规则的字符串"

    class ComplexTypeError(PydanticErrorBase):
        """
        复数类型错误

        This error is raised when the input value cannot be interpreted as a complex number:

        Translation:
            当输入值无法被解析为复数时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     num: complex
            >>>
            >>> try:
            >>>     Model(num=False)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "complex_type"

        References:
            - https://errors.pydantic.dev/2.10/v/complex_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#complex_type
        """

        code = "complex_type"
        msg_template = (
            "Input should be a valid python complex object, a number, or a valid complex string "
            "following the rules at https://docs.python.org/3/library/functions.html#complex"
        )
        msg_template_zh_cn = "输入应为有效的 Python 复数对象、数字或有效的复数格式字符串"

    class DataclassExactTypeError(PydanticErrorBase):
        """
        数据类实例错误

        This error is raised when validating a dataclass with `strict=True`
        and the input is not an instance of the dataclass:

        Translation:
            当使用 `strict=True` 验证数据类 且 输入不是该数据类的实例时，会引发此错误。

        Examples:
            >>> import pydantic.dataclasses
            >>> from pydantic import TypeAdapter, ValidationError
            >>>
            >>> @pydantic.dataclasses.dataclass
            >>> class MyDataclass:
            >>>     x: str
            >>>
            >>> adapter = TypeAdapter(MyDataclass)
            >>>
            >>> print(adapter.validate_python(MyDataclass(x="test"), strict=True))
            MyDataclass(x="test")
            >>> print(adapter.validate_python({"x": "test"}))
            MyDataclass(x="test")
            >>>
            >>> try:
            >>>     adapter.validate_python({"x": "test"}, strict=True)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "dataclass_exact_type"

        References:
            - https://errors.pydantic.dev/2.10/v/dataclass_exact_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#dataclass_exact_type
        """

        code = "dataclass_exact_type"
        msg_template = "Input should be an instance of {class_name}"
        msg_template_zh_cn = "输入应为 <{class_name}> 的实例"

    class DataclassTypeError(PydanticErrorBase):
        """
        数据类类型错误

        This error is raised when the input value is not valid for a `dataclass` field:

        Translation:
            当输入值不适用于 `dataclass` 字段时，会引发此错误。

        Examples:
            >>> from pydantic import ValidationError, dataclasses
            >>>
            >>> @dataclasses.dataclass
            >>> class Inner:
            >>>     x: int
            >>>
            >>> @dataclasses.dataclass
            >>> class Outer:
            >>>     y: Inner
            >>>
            >>> Outer(y=Inner(x=1))  # OK
            >>>
            >>> try:
            >>>     Outer(y=1)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "dataclass_type"

        References:
            - https://errors.pydantic.dev/2.10/v/dataclass_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#dataclass_type
        """

        code = "dataclass_type"
        msg_template = "Input should be a dictionary or an instance of {class_name}"
        msg_template_zh_cn = "输入应为字典或 <{class_name}> 的实例"

    class DateFromDatetimeInexactError(PydanticErrorBase):
        """
        日期时间转换不精确错误

        This error is raised when the input `datetime` value provided for a `date` field has a nonzero time component.
        For a timestamp to parse into a field of type `date`, the time components must all be zero:

        Translation:
            当为 `date` 字段提供的 `datetime` 输入值包含非零时间分量时，会引发此错误。
            要将时间戳解析为 `date` 类型字段，时间分量必须全部为零。

        Examples:
            >>> from datetime import date, datetime
            >>>
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: date
            >>>
            >>> Model(x="2023-01-01")  # OK
            >>> Model(x=datetime(2023, 1, 1))  # OK
            >>>
            >>> try:
            >>>     Model(x=datetime(2023, 1, 1, 12))
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "date_from_datetime_inexact"

        References:
            - https://errors.pydantic.dev/2.10/v/date_from_datetime_inexact
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#date_from_datetime_inexact
        """

        code = "date_from_datetime_inexact"
        msg_template = "Datetimes provided to dates should have zero time - e.g. be exact dates"
        msg_template_zh_cn = "提供给日期字段的 datetime 值应保持零时间分量（即必须是精确日期）"

    class DateFromDatetimeParsingError(PydanticErrorBase):
        """
        日期解析错误

        This error is raised when the input value is a string that cannot be parsed for a `date` field:

        Translation:
            当输入值是无法解析为 `date` 字段的字符串时，会引发此错误。

        Examples:
            >>> from datetime import date
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: date
            >>>
            >>> try:
            >>>     Model(x="XX1494012000")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "date_from_datetime_parsing"

        References:
            - https://errors.pydantic.dev/2.10/v/date_from_datetime_parsing
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#date_from_datetime_parsing
        """

        code = "date_from_datetime_parsing"
        # msg_template = "Input should be a valid date or datetime, {error}",  # error 已手动移除
        msg_template = "Input should be a valid date or datetime"
        msg_template_zh_cn = "输入应为有效的日期或日期时间"

    class DateFutureError(PydanticErrorBase):
        """
        未来的日期错误

        This error is raised when the input value provided for a `FutureDate` field is not in the future:

        Translation:
            当为 `FutureDate` 字段提供的输入值不是未来时间时，会引发此错误。

        Examples:
            >>> from datetime import date
            >>> from pydantic import BaseModel, FutureDate, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: FutureDate
            >>>
            >>> try:
            >>>     Model(x=date(2000, 1, 1))
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "date_future"

        References:
            - https://errors.pydantic.dev/2.10/v/date_future
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#date_future
        """

        code = "date_future"
        msg_template = "Date should be in the future"
        msg_template_zh_cn = "日期应为未来的时间"

    class DateParsingError(PydanticErrorBase):
        """
        日期解析错误

        This error is raised when validating JSON where the input value is string that cannot be parsed for a `date` field:

        Translation:
            当验证 JSON 时，若输入值是无法解析为 `date` 字段的字符串，则会引发此错误。

        Examples:
            >>> import json
            >>> from datetime import date
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: date = Field(strict=True)
            >>>
            >>> try:
            >>>     Model.model_validate_json(json.dumps({"x": "1"}))
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "date_parsing"

        References:
            - https://errors.pydantic.dev/2.10/v/date_parsing
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#date_parsing
        """

        code = "date_parsing"
        # msg_template = "Input should be a valid date in the format YYYY-MM-DD, {error}"  # error 已手动移除
        msg_template = "Input should be a valid date in the format YYYY-MM-DD"
        msg_template_zh_cn = "输入应为 YYYY-MM-DD 格式的有效日期"

    class DatePastError(PydanticErrorBase):
        """
        过去的日期错误

        This error is raised when the value provided for a `PastDate` field is not in the past:

        Translation:
            当为 `PastDate` 字段提供的输入值不是过去时间时，会引发此错误。

        Examples:
            >>> from datetime import date, timedelta
            >>> from pydantic import BaseModel, PastDate, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: PastDate
            >>>
            >>> try:
            >>>     Model(x=date.today() + timedelta(1))
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "date_past"

        References:
            - https://errors.pydantic.dev/2.10/v/date_past
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#date_past
        """

        code = "date_past"
        msg_template = "Date should be in the past"
        msg_template_zh_cn = "日期应为过期的时间"

    class DateTypeError(PydanticErrorBase):
        """
        日期类型错误

        This error is raised when the input value's type is not valid for a `date` field:
        This error is also raised for strict fields when the input value is not an instance of `date`.

        Translation:
            当输入值的类型不适用于 `date` 字段时，会引发此错误。
            对于严格模式字段，当输入值不是 `date` 的实例时也会触发此错误。

        Examples:
            >>> from datetime import date
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: date
            >>>
            >>> try:
            >>>     Model(x=None)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "date_type"

        References:
            - https://errors.pydantic.dev/2.10/v/date_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#date_type
        """

        code = "date_type"
        msg_template = "Input should be a valid date"
        msg_template_zh_cn = "输入应为有效的日期"

    class DatetimeFromDateParsingError(PydanticErrorBase):
        """
        日期时间解析错误

        This error is raised when the input value is a string that cannot be parsed for a `datetime` field:

        Translation:
            当输入值是无法解析为 `datetime` 字段的字符串时，会引发此错误。

        Note:
            Support for this error, along with support for parsing datetimes from `yyyy-MM-DD` dates will be added in `v2.6.0`
            该错误的支持（以及从 `yyyy-MM-DD` 格式日期解析 datetime 的功能）将在 `v2.6.0` 版本中添加。

        Examples:
            >>> from datetime import datetime
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: datetime
            >>>
            >>> try:
            >>>     # there is no 13th month
            >>>     Model(x="2023-13-01")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "datetime_from_date_parsing"

        References:
            - https://errors.pydantic.dev/2.10/v/datetime_from_date_parsing
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#datetime_from_date_parsing
        """

        code = "datetime_from_date_parsing"
        # msg_template = "Input should be a valid datetime or date, {error}"  # error 已手动移除
        msg_template = "Input should be a valid datetime or date"
        msg_template_zh_cn = "输入应为有效的日期时间或日期"

    class DatetimeFutureError(PydanticErrorBase):
        """
        未来的日期时间错误

        This error is raised when the value provided for a `FutureDatetime` field is not in the future:

        Translation:
            当为 `FutureDatetime` 字段提供的值不是未来时间时，会引发此错误。

        Examples:
            >>> from datetime import datetime
            >>> from pydantic import BaseModel, FutureDatetime, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: FutureDatetime
            >>>
            >>> try:
            >>>     Model(x=datetime(2000, 1, 1))
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "datetime_future"

        References:
            - https://errors.pydantic.dev/2.10/v/datetime_future
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#datetime_future
        """

        code = "datetime_future"
        msg_template = "Input should be in the future"
        msg_template_zh_cn = "输入应为未来的日期时间"

    class DatetimeObjectInvalidError(PydanticErrorBase):
        """
        日期时间对象无效错误

        This error is raised when something about the `datetime` object is not valid:

        Translation:
            当 `datetime` 对象存在无效内容时，会引发此错误。

        Examples:
            >>> from datetime import datetime, tzinfo
            >>> from pydantic import AwareDatetime, BaseModel, ValidationError
            >>>
            >>> class CustomTz(tzinfo):
            >>>     # utcoffset is not implemented!
            >>>
            >>>     def tzname(self, _dt):
            >>>         return "CustomTZ"
            >>>
            >>> class Model(BaseModel):
            >>>     x: AwareDatetime
            >>>
            >>> try:
            >>>     Model(x=datetime(2023, 1, 1, tzinfo=CustomTz()))
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "datetime_object_invalid"

        References:
            - https://errors.pydantic.dev/2.10/v/datetime_object_invalid
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#datetime_object_invalid
        """

        code = "datetime_object_invalid"
        # msg_template = "Invalid datetime object, got {error}"  # error 已手动移除
        msg_template = "Invalid datetime object"
        msg_template_zh_cn = "无效的 datetime 对象"

    class DatetimeParsingError(PydanticErrorBase):
        """
        日期时间解析错误

        This error is raised when the value is a string that cannot be parsed for a `datetime` field:

        Translation:
            当输入值是无法解析为 `datetime` 字段的字符串时，会引发此错误。

        Examples:
            >>> import json
            >>> from datetime import datetime
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: datetime = Field(strict=True)
            >>>
            >>> try:
            >>>     Model.model_validate_json(json.dumps({"x": "not a datetime"}))
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "datetime_parsing"

        References:
            - https://errors.pydantic.dev/2.10/v/datetime_parsing
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#datetime_parsing
        """

        code = "datetime_parsing"
        # msg_template = "Input should be a valid datetime, {error}"  # error 已手动移除
        msg_template = "Input should be a valid datetime"
        msg_template_zh_cn = "输入应为有效的日期时间"

    class DatetimePastError(PydanticErrorBase):
        """
        过去的日期时间错误

        This error is raised when the value provided for a `PastDatetime` field is not in the past:

        Translation:
            当为 `PastDatetime` 字段提供的输入值不是过去时间时，会引发此错误。

        Examples:
            >>> from datetime import datetime, timedelta
            >>> from pydantic import BaseModel, PastDatetime, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: PastDatetime
            >>>
            >>> try:
            >>>     Model(x=datetime.now() + timedelta(100))
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "datetime_past"

        References:
            - https://errors.pydantic.dev/2.10/v/datetime_past
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#datetime_past
        """

        code = "datetime_past"
        msg_template = "Input should be in the past"
        msg_template_zh_cn = "输入应为过去的日期时间"

    class DatetimeTypeError(PydanticErrorBase):
        """
        日期时间类型错误

        This error is raised when the input value's type is not valid for a `datetime` field:
        This error is also raised for strict fields when the input value is not an instance of `datetime`.

        Translation:
            当输入值的类型不适用于 `datetime` 字段时，会引发此错误。
            对于严格模式字段，当输入值不是 `datetime` 的实例时也会触发此错误。

        Examples:
            >>> from datetime import datetime
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: datetime
            >>>
            >>> try:
            >>>     Model(x=None)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "datetime_type"

        References:
            - https://errors.pydantic.dev/2.10/v/datetime_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#datetime_type
        """

        code = "datetime_type"
        msg_template = "Input should be a valid datetime"
        msg_template_zh_cn = "输入应为有效的日期时间"

    class DecimalMaxDigitsError(PydanticErrorBase):
        """
        小数位数过长错误

        This error is raised when the value provided for a `Decimal` has too many digits:

        Translation:
            当为 `Decimal` 提供的值位数过多时，会引发此错误。

        Examples:
            >>> from decimal import Decimal
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: Decimal = Field(max_digits=3)
            >>>
            >>> try:
            >>>     Model(x="42.1234")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "decimal_max_digits"

        References:
            - https://errors.pydantic.dev/2.10/v/decimal_max_digits
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#decimal_max_digits
        """

        code = "decimal_max_digits"
        msg_template = "Decimal input should have no more than {max_digits} digits in total"
        msg_template_zh_cn = "小数输入的总位数不应超过 {max_digits} 位"

    class DecimalMaxPlacesError(PydanticErrorBase):
        """
        小数点后位数过多错误

        This error is raised when the value provided for a `Decimal` has too many digits after the decimal point:

        Translation:
            当为 `Decimal` 提供的值在小数点后位数过多时，会引发此错误。

        Examples:
            >>> from decimal import Decimal
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: Decimal = Field(decimal_places=3)
            >>>
            >>> try:
            >>>     Model(x="42.1234")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "decimal_max_places"

        References:
            - https://errors.pydantic.dev/2.10/v/decimal_max_places
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#decimal_max_places
        """

        code = "decimal_max_places"
        msg_template = "Decimal input should have no more than {decimal_places} decimal places"
        msg_template_zh_cn = "Decimal 输入的小数位不应超过 {decimal_places} 位"

    class DecimalParsingError(PydanticErrorBase):
        """
        小数解析错误

        This error is raised when the value provided for a `Decimal` could not be parsed as a decimal number:

        Translation:
            当为 `Decimal` 提供的值无法被解析为十进制数字时，会引发此错误。

        Examples:
            >>> from decimal import Decimal
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: Decimal = Field(decimal_places=3)
            >>>
            >>> try:
            >>>     Model(x="test")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "decimal_parsing"

        References:
            - https://errors.pydantic.dev/2.10/v/decimal_parsing
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#decimal_parsing
        """

        code = "decimal_parsing"
        msg_template = "Input should be a valid decimal"
        msg_template_zh_cn = "输入应为有效的小数"

    class DecimalTypeError(PydanticErrorBase):
        """
        小数类型错误

        This error is raised when the value provided for a `Decimal` is of the wrong type:
        This error is also raised for strict fields when the input value is not an instance of `Decimal`.

        Translation:
            当为 `Decimal` 提供的值类型错误时，会引发此错误。
            对于严格模式字段，当输入值不是 `Decimal` 的实例时也会触发此错误。

        Examples:
            >>> from decimal import Decimal
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: Decimal = Field(decimal_places=3)
            >>>
            >>> try:
            >>>     Model(x=[1, 2, 3])
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "decimal_type"

        References:
            - https://errors.pydantic.dev/2.10/v/decimal_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#decimal_type
        """

        code = "decimal_type"
        msg_template = "Decimal input should be an integer, float, string or Decimal object"
        msg_template_zh_cn = "输入应为整数、浮点数、字符串或小数对象"

    class DecimalWholeDigitsError(PydanticErrorBase):
        """
        小数总位数错误

        This error is raised when the value provided for a `Decimal` has more digits before the decimal
        point than `max_digits` - `decimal_places` (as long as both are specified):
        This error is also raised for strict fields when the input value is not an instance of `Decimal`.

        Translation:
            当为 `Decimal` 提供的值在小数点前的位数超过 `max_digits` - `decimal_places` 的限制时（需同时指定这两个参数），会引发此错误。
            对于严格模式字段，若输入值不是 Decimal 的实例，同样会触发此错误。

        Examples:
            >>> from decimal import Decimal
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: Decimal = Field(max_digits=6, decimal_places=3)
            >>>
            >>> try:
            >>>     Model(x="12345.6")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "decimal_whole_digits"

        References:
            - https://errors.pydantic.dev/2.10/v/decimal_whole_digits
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#decimal_whole_digits
        """

        code = "decimal_whole_digits"
        msg_template = "Decimal input should have no more than {whole_digits} digits before the decimal point"
        msg_template_zh_cn = "输入的小数点前位数不应超过 {whole_digits} 位"

    class DictTypeError(PydanticErrorBase):
        """
        字典类型错误

        This error is raised when the input value's type is not `dict` for a `dict` field:

        Translation:
            当输入值的类型不是 `dict`（字典）时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: dict
            >>>
            >>> try:
            >>>     Model(x=["1", "2"])
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
           " 'dict_type'"

        References:
            - https://errors.pydantic.dev/2.10/v/dict_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#dict_type
        """

        code = "dict_type"
        msg_template = "Input should be a valid dictionary"
        msg_template_zh_cn = "输入应为有效的字典"

    class EnumError(PydanticErrorBase):
        """
        枚举错误

        This error is raised when the input value does not exist in an `enum` field members:

        Translation:
            当输入值不属于 `enum` 字段成员时，会引发此错误。

        Examples:
            >>> from enum import Enum
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class MyEnum(str, Enum):
            >>>     option = 'option'
            >>>
            >>> class Model(BaseModel):
            >>>     x: MyEnum
            >>>
            >>> try:
            >>>     Model(x="other_option")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "enum"

        References:
            - https://errors.pydantic.dev/2.10/v/enum
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#enum
        """

        code = "enum"
        msg_template = "Input should be {expected}"
        msg_template_zh_cn = "输入应为 {expected}"

    class ExtraForbiddenError(PydanticErrorBase):
        """
        额外的字段错误

        This error is raised when the input value contains extra fields, but `model_config["extra"] == "forbid"`:

        Translation:
            当输入值包含额外字段且 `model_config['extra'] == 'forbid'` 时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ConfigDict, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: str
            >>>
            >>>     model_config = ConfigDict(extra="forbid")
            >>>
            >>> try:
            >>>     Model(x="test", y="test")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "extra_forbidden"

        References:
            - https://errors.pydantic.dev/2.10/v/extra_forbidden
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#extra_forbidden
        """

        code = "extra_forbidden"
        msg_template = "Extra inputs are not permitted"
        msg_template_zh_cn = "禁止输入额外字段"

    class FiniteNumberError(PydanticErrorBase):
        """
        有限数值错误

        This error is raised when the value is infinite, or too large to be represented as a 64-bit
        floating point number during validation:

        Translation:
            当验证过程中数值为无限大或超出 64 位浮点数表示范围时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: int
            >>>
            >>> try:
            >>>     Model(x=2.2250738585072011e308)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "finite_number"

        References:
            - https://errors.pydantic.dev/2.10/v/finite_number
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#finite_number
        """

        code = "finite_number"
        msg_template = "Input should be a finite number"
        msg_template_zh_cn = "输入应为有限数值"

    class FloatParsingError(PydanticErrorBase):
        """
        浮点数解析错误

        This error is raised when the value is a string that can't be parsed as a `float`:

        Translation:
            当输入值是无法解析为 `float` 的字符串时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: float
            >>>
            >>> try:
            >>>     Model(x="test")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "float_parsing"

        References:
            - https://errors.pydantic.dev/2.10/v/float_parsing
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#float_parsing
        """

        code = "float_parsing"
        msg_template = "Input should be a valid number, unable to parse string as a number"
        msg_template_zh_cn = "输入应为有效数字，无法将字符串解析为数字"

    class FloatTypeError(PydanticErrorBase):
        """
        浮点数类型错误

        This error is raised when the input value's type is not valid for a `float` field:

        Translation:
            当输入值的类型不适用于 `float` 字段时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: float
            >>>
            >>> try:
            >>>     Model(x=None)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "float_type"

        References:
            - https://errors.pydantic.dev/2.10/v/float_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#float_type
        """

        code = "float_type"
        msg_template = "Input should be a valid number"
        msg_template_zh_cn = "输入应为有效数字"

    class FrozenFieldError(PydanticErrorBase):
        """
        字段冻结错误

        This error is raised when you attempt to assign a value to a field with `frozen=True`, or to delete such a field:

        Translation:
            当尝试为 `frozen=True` 的字段赋值或删除此类字段时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: str = Field("test", frozen=True)
            >>>
            >>> model = Model()
            >>>
            >>> try:
            >>>     model.x = "test1"
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            'frozen_field'
            >>>
            >>> try:
            >>>     del model.x
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "frozen_field"

        References:
            - https://errors.pydantic.dev/2.10/v/frozen_field
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#frozen_field
        """

        code = "frozen_field"
        msg_template = "Field is frozen"
        msg_template_zh_cn = "字段已冻结，无法修改"

    class FrozenInstanceError(PydanticErrorBase):
        """
        实例冻结错误

        This error is raised when `model_config['frozen] == True` and you attempt to delete or assign a new value to any of the fields:

        Translation:
            当 `model_config['frozen'] == True` 且你试图删除或为任何字段分配新值时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ConfigDict, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: int
            >>>
            >>>     model_config = ConfigDict(frozen=True)
            >>>
            >>> m = Model(x=1)
            >>>
            >>> try:
            >>>     m.x = 2
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "frozen_instance"
            >>>
            >>> try:
            >>>     del m.x
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "frozen_instance"

        References:
            - https://errors.pydantic.dev/2.10/v/frozen_instance
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#frozen_instance
        """

        code = "frozen_instance"
        msg_template = "Instance is frozen"
        msg_template_zh_cn = "实例已冻结，无法修改"

    class FrozenSetTypeError(PydanticErrorBase):
        """
        不可变集合类型错误

        This error is raised when the input value's type is not valid for a `frozenset` field:

        Translation:
            当输入值的类型不符合 frozenset 字段的类型要求时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: frozenset
            >>>
            >>> try:
            >>>     model = Model(x="test")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "frozen_set_type"

        References:
            - https://errors.pydantic.dev/2.10/v/frozen_set_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#frozen_set_type
        """

        code = "frozen_set_type"
        msg_template = "Input should be a valid frozenset"
        msg_template_zh_cn = "输入应为有效的不可变集合"

    class GetAttributeErrorError(PydanticErrorBase):
        """
        属性读取错误

        This error is raised when `model_config["from_attributes"] == True` and an error is raised while reading the attributes:

        Translation:
            当 `model_config["from_attributes"] == True` 且在读取属性时发生错误时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ConfigDict, ValidationError
            >>>
            >>> class Foobar:
            >>>     def __init__(self):
            >>>         self.x = 1
            >>>
            >>>     @property
            >>>     def y(self):
            >>>         raise RuntimeError("intentional error")
            >>>
            >>> class Model(BaseModel):
            >>>     x: int
            >>>     y: str
            >>>
            >>>     model_config = ConfigDict(from_attributes=True)
            >>>
            >>> try:
            >>>     Model.model_validate(Foobar())
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "get_attribute_error"

        References:
            - https://errors.pydantic.dev/2.10/v/get_attribute_error
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#get_attribute_error
        """

        code = "get_attribute_error"
        # msg_template = "Error extracting attribute: {error}"  # error 已手动移除
        msg_template = "Error extracting attribute"
        msg_template_zh_cn = "属性读取错误"

    class GreaterThanError(PydanticErrorBase):
        """
        输入值大于错误

        This error is raised when the value is not greater than the field's `gt` constraint:

        Translation:
            当值不大于字段的 gt（大于）约束时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: int = Field(gt=10)
            >>>
            >>> try:
            >>>     Model(x=10)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "greater_than"

        References:
            - https://errors.pydantic.dev/2.10/v/greater_than
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#greater_than
        """

        code = "greater_than"
        msg_template = "Input should be greater than {gt}"
        msg_template_zh_cn = "输入应大于 {gt}"

    class GreaterThanEqualError(PydanticErrorBase):
        """
        输入值大于等于错误

        This error is raised when the value is not greater than or equal to the field's `ge` constraint:

        Translation:
            当值不大于或等于字段的 ge（大于等于）约束时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: int = Field(ge=10)
            >>>
            >>> try:
            >>>     Model(x=9)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "greater_than_equal"

        References:
            - https://errors.pydantic.dev/2.10/v/greater_than_equal
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#greater_than_equal
        """

        code = "greater_than_equal"
        msg_template = "Input should be greater than or equal to {ge}"
        msg_template_zh_cn = "输入应大于等于 {ge}"

    class IntFromFloatError(PydanticErrorBase):
        """
        整数输入小数错误

        This error is raised when you provide a `float` value for an `int` field:

        Translation:
            当为 int 类型的字段提供 float 类型的值时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: int
            >>>
            >>> try:
            >>>     Model(x=0.5)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "int_from_float"

        References:
            - https://errors.pydantic.dev/2.10/v/int_from_float
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#int_from_float
        """

        code = "int_from_float"
        msg_template = "Input should be a valid integer, got a number with a fractional part"
        msg_template_zh_cn = "输入应为有效的整数，但却得到了一个带有小数部分的数"

    class IntParsingError(PydanticErrorBase):
        """
        整数解析错误

        This error is raised when the value can't be parsed as `int`:

        Translation:
            当无法将值解析为 `int` 类型时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: int
            >>>
            >>> try:
            >>>     Model(x="test")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "int_parsing"

        References:
            - https://errors.pydantic.dev/2.10/v/int_parsing
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#int_parsing
        """

        code = "int_parsing"
        msg_template = "Input should be a valid integer, unable to parse string as an integer"
        msg_template_zh_cn = "输入应当是有效的整数，无法将字符串解析为整数"

    class IntParsingSizeError(PydanticErrorBase):
        """
        整数解析范围错误

        This error is raised when attempting to parse a python or JSON value from a string
        outside the maximum range that Python `str` to `int` parsing permits:

        Translation:
            当尝试从超出 Python `str` 到 `int` 解析允许的最大范围的字符串中解析 Python 或 JSON 值时，会引发此错误。

        Examples:
            >>> import json
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: int
            >>>
            >>> # from Python
            >>> assert Model(x="1" * 4_300).x == int("1" * 4_300)  # OK
            >>>
            >>> too_long = "1" * 4_301
            >>> try:
            >>>     Model(x=too_long)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "int_parsing_size"
            >>>
            >>> # from JSON
            >>> try:
            >>>     Model.model_validate_json(json.dumps({"x": too_long}))
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "int_parsing_size"

        References:
            - https://errors.pydantic.dev/2.10/v/int_parsing_size
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#int_parsing_size
        """

        code = "int_parsing_size"
        msg_template = "Unable to parse input string as an integer, exceeded maximum size"
        msg_template_zh_cn = "无法将输入字符串解析为整数，已超出最大尺寸限制。"

    class IntTypeError(PydanticErrorBase):
        """
        整数类型错误

        This error is raised when the input value's type is not valid for an `int` field:

        Translation:
            当输入值的类型不符合 `int` 字段的要求时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: int
            >>>
            >>> try:
            >>>     Model(x=None)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "int_type"

        References:
            - https://errors.pydantic.dev/2.10/v/int_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#int_type
        """

        code = "int_type"
        msg_template = "Input should be a valid integer"
        msg_template_zh_cn = "输入应为有效的整数"

    class InvalidKeyError(PydanticErrorBase):
        """
        无效的键错误

        This error is raised when attempting to validate a `dict` that has a key that is not an instance of `str`:

        Translation:
            当尝试验证一个 `dict`，而其中某个键并非 `str` 实例时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ConfigDict, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: int
            >>>
            >>>     model_config = ConfigDict(extra="allow")
            >>>
            >>> try:
            >>>     Model.model_validate({"x": 1, b"y": 2})
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "invalid_key"

        References:
            - https://errors.pydantic.dev/2.10/v/invalid_key
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#invalid_key
        """

        code = "invalid_key"
        msg_template = "Keys should be strings"
        msg_template_zh_cn = "键应为字符串类型"

    class IsInstanceOfError(PydanticErrorBase):
        """
        实例错误

        This error is raised when the input value is not an instance of the expected type:

        Translation:
            当输入值不是预期类型的实例时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ConfigDict, ValidationError
            >>>
            >>> class Nested:
            >>>     x: str
            >>>
            >>> class Model(BaseModel):
            >>>     y: Nested
            >>>
            >>>     model_config = ConfigDict(arbitrary_types_allowed=True)
            >>>
            >>> try:
            >>>     Model(y="test")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "is_instance_of"

        References:
            - https://errors.pydantic.dev/2.10/v/is_instance_of
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#is_instance_of
        """

        code = "is_instance_of"
        msg_template = "Input should be an instance of {class}"
        msg_template_zh_cn = "输入应为 {class} 的实例"

    class IsSubclassOfError(PydanticErrorBase):
        """
        子类错误

        This error is raised when the input value is not a subclass of the expected type:

        Translation:
            当输入值不是预期类型的子类时，会引发此错误。

        Examples:
            >>> from typing import Type
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Nested:
            >>>     x: str
            >>>
            >>> class Model(BaseModel):
            >>>     y: type[Nested]
            >>>
            >>> try:
            >>>     Model(y="test")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "is_subclass_of"

        References:
            - https://errors.pydantic.dev/2.10/v/is_subclass_of
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#is_subclass_of
        """

        code = "is_subclass_of"
        msg_template = "Input should be a subclass of {class}"
        msg_template_zh_cn = "输入应为 {class} 的子类"

    class IterableTypeError(PydanticErrorBase):
        """
        可迭代对象错误

        This error is raised when the input value is not valid as an `Iterable`:

        Translation:
            当输入值不符合 `Iterable` 的有效格式时，会引发此错误：

        Examples:
            >>> from typing import Iterable
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     y: Iterable
            >>>
            >>> try:
            >>>     Model(y=123)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "iterable_type"

        References:
            - https://errors.pydantic.dev/2.10/v/iterable_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#iterable_type
        """

        code = "iterable_type"
        msg_template = "Input should be iterable"
        msg_template_zh_cn = "输入应为可迭代对象"

    class IterationErrorError(PydanticErrorBase):
        """
        迭代错误

        This error is raised when an error occurs during iteration:

        Translation:
            当在迭代过程中发生错误时，会引发此错误。

        Examples:
            >>> from typing import List
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> def gen():
            >>>     yield 1
            >>>     raise RuntimeError("error")
            >>>
            >>> class Model(BaseModel):
            >>>     x: List[int]
            >>>
            >>> try:
            >>>     Model(x=gen())
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "iteration_error"

        References:
            - https://errors.pydantic.dev/2.10/v/iteration_error
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#iteration_error
        """

        code = "iteration_error"
        # msg_template = "Error iterating over object, error: {error}"  # error 已手动移除
        msg_template = "Error iterating over object"
        msg_template_zh_cn = "迭代对象时发生错误"

    class JsonInvalidError(PydanticErrorBase):
        """
        无效的 JSON 错误

        This error is raised when the input value is not a valid JSON string:

        Translation:
            当输入值不是有效的 JSON 字符串时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, Json, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: Json
            >>>
            >>> try:
            >>>     Model(x="test")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "json_invalid"

        References:
            - https://errors.pydantic.dev/2.10/v/json_invalid
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#json_invalid
        """

        code = "json_invalid"
        # msg_template = "Invalid JSON: {error}"  # error 已手动移除
        msg_template = "Invalid JSON"
        msg_template_zh_cn = "无效的 JSON 字符串"

    class JsonTypeError(PydanticErrorBase):
        """
        JSON 类型错误

        This error is raised when the input value is of a type that cannot be parsed as JSON:

        Translation:
            当输入值的类型无法被解析为 JSON 时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, Json, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: Json
            >>>
            >>> try:
            >>>     Model(x=None)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "json_type"

        References:
            - https://errors.pydantic.dev/2.10/v/json_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#json_type
        """

        code = "json_type"
        msg_template = "JSON input should be string, bytes or bytearray"
        msg_template_zh_cn = "JSON 输入应为字符串、字节或字节数组"

    class LessThanError(PydanticErrorBase):
        """
        输入值小于错误

        This error is raised when the input value is not less than the field's `lt` constraint:

        Translation:
            当输入值不小于字段的 `lt`（小于）约束时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: int = Field(lt=10)
            >>>
            >>> try:
            >>>     Model(x=10)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "less_than"

        References:
            - https://errors.pydantic.dev/2.10/v/less_than
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#less_than
        """

        code = "less_than"
        msg_template = "Input should be less than {lt}"
        msg_template_zh_cn = "输入应小于 {lt}"

    class LessThanEqualError(PydanticErrorBase):
        """
        输入值小于等于错误

        This error is raised when the input value is not less than or equal to the field's `le` constraint:

        Translation:
            当输入值不小于或等于字段的 `le`（小于等于）约束时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: int = Field(le=10)
            >>>
            >>> try:
            >>>     Model(x=11)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "less_than_equal"

        References:
            - https://errors.pydantic.dev/2.10/v/less_than_equal
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#less_than_equal
        """

        code = "less_than_equal"
        msg_template = "Input should be less than or equal to {le}"
        msg_template_zh_cn = "输入应小于等于 {le}"

    class ListTypeError(PydanticErrorBase):
        """
        列表类型错误

        This error is raised when the input value's type is not valid for a `list` field:

        Translation:
            当输入值的类型不符合 `list` 字段的要求时，会引发此错误。

        Examples:
            >>> from typing import List
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: List[int]
            >>>
            >>> try:
            >>>     Model(x=1)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "list_type"

        References:
            - https://errors.pydantic.dev/2.10/v/list_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#list_type
        """

        code = "list_type"
        msg_template = "Input should be a valid list"
        msg_template_zh_cn = "输入应为有效的列表"

    class LiteralError(PydanticErrorBase):
        """
        字面量值错误

        This error is raised when the input value is not one of the expected literal values:

        Translation:
            当输入值不是预期的字面量值之一时，会引发此错误。

        Examples:
            >>> from typing import Literal
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: Literal["a", "b"]
            >>>
            >>> Model(x="a")  # OK
            >>>
            >>> try:
            >>>     Model(x="c")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "literal_error"

        References:
            - https://errors.pydantic.dev/2.10/v/literal_error
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#literal_error
        """

        code = "literal_error"
        msg_template = "Input should be {expected}"  # TODO: 拼接待优化 expected = "'a' or 'b'"
        msg_template_zh_cn = "输入应为 {expected}"

    class MappingTypeError(PydanticErrorBase):
        """
        映射类型错误

        This error is raised when a problem occurs during validation due to a failure in a call to 
        the methods from the `Mapping` protocol, such as `.items()`:

        Translation:
            当在验证过程中因调用 `Mapping` 协议的方法（如 `.items()`）失败而出现问题时，会引发此错误。

        Examples:
            >>> from collections.abc import Mapping
            >>> from typing import Dict
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class BadMapping(Mapping):
            >>>     def items(self):
            >>>         raise ValueError()
            >>>
            >>>     def __iter__(self):
            >>>         raise ValueError()
            >>>
            >>>     def __getitem__(self, key):
            >>>         raise ValueError()
            >>>
            >>>     def __len__(self):
            >>>         return 1
            >>>
            >>> class Model(BaseModel):
            >>>     x: DictStrStr
            >>>
            >>> try:
            >>>     Model(x=BadMapping())
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "mapping_type"

        References:
            - https://errors.pydantic.dev/2.10/v/mapping_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#mapping_type
        """

        code = "mapping_type"
        # msg_template = "Input should be a valid mapping, error: {error}"  # error 已手动移除
        msg_template = "Input should be a valid mapping"
        msg_template_zh_cn = "输入应为有效的映射对象（如字典）"

    class MissingError(PydanticErrorBase):
        """
        必填字段未填错误

        This error is raised when there are required fields missing from the input value:

        Translation:
            当输入值中缺少必需字段时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: str
            >>>
            >>> try:
            >>>     Model()
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "missing"

        References:
            - https://errors.pydantic.dev/2.10/v/missing
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#missing
        """

        code = "missing"
        msg_template = "Field required"
        msg_template_zh_cn = "字段是必填的"

    class MissingArgumentError(PydanticErrorBase):
        """
        参数缺失错误

        This error is raised when a required positional-or-keyword argument is not passed to 
        a function decorated with `validate_call`:

        Translation:
            当使用 `validate_call` 装饰的函数缺少必需的位置或关键字参数时，会引发此错误。

        Examples:
            >>> from pydantic import ValidationError, validate_call
            >>>
            >>> @validate_call
            >>> def foo(a: int):
            >>>     return a
            >>>
            >>> try:
            >>>     foo()
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "missing_argument"

        References:
            - https://errors.pydantic.dev/2.10/v/missing_argument
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#missing_argument
        """

        code = "missing_argument"
        msg_template = "Missing required argument"
        msg_template_zh_cn = "缺失必填参数"

    class MissingKeywordOnlyArgumentError(PydanticErrorBase):
        """
        仅关键字参数缺失错误

        This error is raised when a required keyword-only argument is not passed to a function decorated with `validate_call`:

        Translation:
            当使用 `validate_call` 装饰的函数缺少必需的仅关键字参数时，会引发此错误。

        Examples:
            >>> from pydantic import ValidationError, validate_call
            >>>
            >>> @validate_call
            >>> def foo(*, a: int):
            >>>     return a
            >>>
            >>> try:
            >>>     foo()
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "missing_keyword_only_argument"

        References:
            - https://errors.pydantic.dev/2.10/v/missing_keyword_only_argument
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#missing_keyword_only_argument
        """

        code = "missing_keyword_only_argument"
        msg_template = "Missing required keyword only argument"
        msg_template_zh_cn = "缺少必需的仅关键字参数"

    class MissingPositionalOnlyArgumentError(PydanticErrorBase):
        """
        仅位置参数缺失错误

        This error is raised when a required positional-only argument is not passed to a function decorated with `validate_call`:

        Translation:
            当使用 `validate_call` 装饰的函数缺少必需的仅位置参数时，会引发此错误。

        Examples:
            >>> from pydantic import ValidationError, validate_call
            >>>
            >>> @validate_call
            >>> def foo(a: int, /):
            >>>     return a
            >>>
            >>> try:
            >>>     foo()
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "missing_positional_only_argument"

        References:
            - https://errors.pydantic.dev/2.10/v/missing_positional_only_argument
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#missing_positional_only_argument
        """

        code = "missing_positional_only_argument"
        msg_template = "Missing required positional only argument"
        msg_template_zh_cn = "缺少必需的仅位置参数"

    class ModelAttributesTypeError(PydanticErrorBase):
        """
        模型属性类型错误

        This error is raised when the input value is not a valid dictionary, model instance, or instance 
        that fields can be extracted from:

        Translation:
            当输入值不是有效的字典、模型实例或无法从中提取字段的实例时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     a: int
            >>>     b: int
            >>>
            >>> # simply validating a dict
            >>> print(Model.model_validate({"a": 1, "b": 2}))
            a=1 b=2
            >>>
            >>> class CustomObj:
            >>>     def __init__(self, a, b):
            >>>         self.a = a
            >>>         self.b = b
            >>>
            >>> # using from attributes to extract fields from an objects
            >>> print(Model.model_validate(CustomObj(3, 4), from_attributes=True))
            a=3 b=4
            >>>
            >>> try:
            >>>     Model.model_validate("not an object", from_attributes=True)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "model_attributes_type"

        References:
            - https://errors.pydantic.dev/2.10/v/model_attributes_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#model_attributes_type
        """

        code = "model_attributes_type"
        msg_template = "Input should be a valid dictionary or object to extract fields from"
        msg_template_zh_cn = "输入应为有效的字典或可从中提取字段的对象"

    class ModelTypeError(PydanticErrorBase):
        """
        模型类型错误

        This error is raised when the input to a model is not an instance of the model or dict:

        Translation:
            当模型的输入既不是该模型的实例也不是字典时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     a: int
            >>>     b: int
            >>>
            >>> # simply validating a dict
            >>> m = Model.model_validate({"a": 1, "b": 2})
            >>> print(m)
            a=1 b=2
            >>>
            >>> # validating an existing model instance
            >>> print(Model.model_validate(m))
            a=1 b=2
            >>>
            >>> try:
            >>>     Model.model_validate("not an object")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "model_type"

        References:
            - https://errors.pydantic.dev/2.10/v/model_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#model_type
        """

        code = "model_type"
        msg_template = "Input should be a valid dictionary or instance of {class_name}"
        msg_template_zh_cn = "输入应为有效的字典或 {class_name} 类的实例"

    class MultipleArgumentValuesError(PydanticErrorBase):
        """
        多个参数值错误

        This error is raised when you provide multiple values for a single argument while calling 
        a function decorated with `validate_call`:

        Translation:
            当调用使用 `validate_call` 装饰的函数时，若为单个参数提供了多个值，则会引发此错误。

        Examples:
            >>> from pydantic import ValidationError, validate_call
            >>>
            >>> @validate_call
            >>> def foo(a: int):
            >>>     return a
            >>>
            >>> try:
            >>>     foo(1, a=2)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "multiple_argument_values"

        References:
            - https://errors.pydantic.dev/2.10/v/multiple_argument_values
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#multiple_argument_values
        """

        code = "multiple_argument_values"
        msg_template = "Got multiple values for argument"
        msg_template_zh_cn = "为参数提供了多个值"

    class MultipleOfError(PydanticErrorBase):
        """
        倍数错误

        This error is raised when the input is not a multiple of a field's `multiple_of` constraint:

        Translation:
            当输入值不是字段 `multiple_of` 约束所指定数值的倍数时，会引发此错误。
        Examples:
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: int = Field(multiple_of=5)
            >>>
            >>> try:
            >>>     Model(x=1)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "multiple_of"

        References:
            - https://errors.pydantic.dev/2.10/v/multiple_of
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#multiple_of
        """

        code = "multiple_of"
        msg_template = "Input should be a multiple of {multiple_of}"
        msg_template_zh_cn = "输入值必须是 {multiple_of} 的倍数"

    class NeedsPythonObjectError(PydanticErrorBase):
        """
        需要 Python 对象错误

        This type of error is raised when validation is attempted from a format that cannot be converted to a Python object.
        For example, we cannot check `isinstance` or `issubclass` from JSON:

        Translation:
            当尝试从无法转换为 Python 对象的格式进行验证时，会引发此类错误。
            例如，无法对 JSON 数据执行 isinstance 或 issubclass 检查。

        Examples:
            >>> import json
            >>> from typing import Type
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     bm: type[BaseModel]
            >>>
            >>> try:
            >>>     Model.model_validate_json(json.dumps({"bm": "not a basemodel class"}))
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "needs_python_object"

        References:
            - https://errors.pydantic.dev/2.10/v/needs_python_object
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#needs_python_object
        """

        code = "needs_python_object"
        msg_template = "Cannot check `{method_name}` when validating from json, use a JsonOrPython validator instead"
        msg_template_zh_cn = "当从 JSON 数据进行验证时，无法直接调用 {method_name}，需使用支持 JSON 解析的验证器（如 JsonOrPython）替代"

    class NoSuchAttributeError(PydanticErrorBase):
        """
        对象属性不存在错误

        This error is raised when `validate_assignment=True` in the config, and you attempt to assign 
        a value to an attribute that is not an existing field:

        Translation:
            当在配置中设置 `validate_assignment=True` 且尝试为不存在的字段赋值时，会引发此错误

        Examples:
            >>> from pydantic import ConfigDict, ValidationError, dataclasses
            >>>
            >>> @dataclasses.dataclass(config=ConfigDict(validate_assignment=True))
            >>> class MyDataclass:
            >>>     x: int
            >>>
            >>> m = MyDataclass(x=1)
            >>>
            >>> try:
            >>>     m.y = 10
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "no_such_attribute"

        References:
            - https://errors.pydantic.dev/2.10/v/no_such_attribute
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#no_such_attribute
        """

        code = "no_such_attribute"
        msg_template = "Object has no attribute '{attribute}'"
        msg_template_zh_cn = "对象没有 <{attribute}> 属性"

    class NoneRequiredError(PydanticErrorBase):
        """
        输入不为 None 错误

        This error is raised when the input value is not `None` for a field that requires `None`:

        Translation:
            当某个字段要求值为 None，但输入的是非 None 值时，会引发此错误

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: None
            >>>
            >>> try:
            >>>     Model(x=1)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "none_required"

        References:
            - https://errors.pydantic.dev/2.10/v/none_required
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#none_required
        """

        code = "none_required"
        msg_template = "Input should be None"
        msg_template_zh_cn = "输入应为 None"

    class RecursionLoopError(PydanticErrorBase):
        """
        循环引用错误

        This error is raised when a cyclic reference is detected:

        Translation:
            当检测到循环引用时，会引发此错误

        Examples:
            >>> from typing import List
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: list["Model"]
            >>>
            >>> d = {"x": []}
            >>> d["x"].append(d)
            >>>
            >>> try:
            >>>     Model(**d)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "recursion_loop"

        References:
            - https://errors.pydantic.dev/2.10/v/recursion_loop
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#recursion_loop
        """

        code = "recursion_loop"
        msg_template = "Recursion error - cyclic reference detected"
        msg_template_zh_cn = "递归错误 - 检测到循环引用"

    class SetTypeError(PydanticErrorBase):
        """
        集合类型错误

        This error is raised when the value type is not valid for a `set` field:

        Translation:
            当值的类型对于集合（set）字段无效时，会引发此错误。

        Examples:
            >>> from typing import Set
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: Set[int]
            >>>
            >>> try:
            >>>     Model(x="test")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "set_type"

        References:
            - https://errors.pydantic.dev/2.10/v/set_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#set_type
        """

        code = "set_type"
        msg_template = "Input should be a valid set"
        msg_template_zh_cn = "输入应为有效的集合"

    class StringPatternMismatchError(PydanticErrorBase):
        """
        字符串模式不匹配错误

        This error is raised when the input value doesn't match the field's `pattern` constraint:

        Translation:
            当输入值不符合字段的 `pattern` 约束时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: str = Field(pattern="test")
            >>>
            >>> try:
            >>>     Model(x="1")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "string_pattern_mismatch"

        References:
            - https://errors.pydantic.dev/2.10/v/string_pattern_mismatch
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#string_pattern_mismatch
        """

        code = "string_pattern_mismatch"
        msg_template = "String should match pattern '{pattern}'"
        msg_template_zh_cn = "字符串应匹配模式 '{pattern}'"

    class StringSubTypeError(PydanticErrorBase):
        """
        字符串子类型错误

        This error is raised when the value is an instance of a strict subtype of `str` when the field is strict:

        Translation:
            当字段为严格类型时，如果值是 `str` 的严格子类型的实例，则会引发此错误。

        Examples:
            >>> from enum import Enum
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class MyEnum(str, Enum):
            >>>     foo = "foo"
            >>>
            >>> class Model(BaseModel):
            >>>     x: str = Field(strict=True)
            >>>
            >>> try:
            >>>     Model(x=MyEnum.foo)  # 官网的 Demo 不会报错，无法复现...
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "string_sub_type"

        References:
            - https://errors.pydantic.dev/2.10/v/string_sub_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#string_sub_type
        """

        code = "string_sub_type"
        msg_template = ""  # TODO: 无法复现
        msg_template_zh_cn = ""

    class StringTooLongError(PydanticErrorBase):
        """
        字符串长度过长错误

        This error is raised when the input value is a string whose length is greater than the field's `max_length` constraint:

        Translation:
            中文翻译当输入值是一个字符串，但其长度超过了字段的 `max_length` 约束时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: str = Field(max_length=3)
            >>>
            >>> try:
            >>>     Model(x="test")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "string_too_long"

        References:
            - https://errors.pydantic.dev/2.10/v/string_too_long
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#string_too_long
        """

        code = "string_too_long"
        msg_template = "String should have at most {max_length} characters"
        msg_template_zh_cn = "字符串的长度最多应为 {max_length} 个字符"

    class StringTooShortError(PydanticErrorBase):
        """
        字符串长度过端错误

        This error is raised when the input value is a string whose length is less than the field's `min_length` constraint:

        Translation:
            当输入值为字符串且其长度小于字段的 `min_length` 约束时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: str = Field(min_length=3)
            >>>
            >>> try:
            >>>     Model(x="t")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "string_too_short"

        References:
            - https://errors.pydantic.dev/2.10/v/string_too_short
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#string_too_short
        """

        code = "string_too_short"
        msg_template = "String should have at least {min_length} characters"
        msg_template_zh_cn = "字符串的长度至少应为 {min_length} 个字符"

    class StringTypeError(PydanticErrorBase):
        """
        字符串类型错误

        This error is raised when the input value's type is not valid for a `str` field:
        This error is also raised for strict fields when the input value is not an instance of `str`.

        Translation:
            当输入值的类型对于 `str` 字段无效时，会引发此错误。
            当严格字段的输入值不是 `str` 的实例时，也会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: str
            >>>
            >>> try:
            >>>     Model(x=1)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "string_type"

        References:
            - https://errors.pydantic.dev/2.10/v/string_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#string_type
        """

        code = "string_type"
        msg_template = "Input should be a valid string"
        msg_template_zh_cn = "输入应为有效的字符串"

    class StringUnicodeError(PydanticErrorBase):
        """
        字符串 Unicode 解析错误

        This error is raised when the value cannot be parsed as a Unicode string:

        Translation:
            当值无法被解析为 Unicode 字符串时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: str
            >>>
            >>> try:
            >>>     Model(x=b"\x81")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "string_unicode"

        References:
            - https://errors.pydantic.dev/2.10/v/string_unicode
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#string_unicode
        """

        code = "string_unicode"
        msg_template = "Input should be a valid string, unable to parse raw data as a unicode string"
        msg_template_zh_cn = "输入应为有效字符串，无法将原始数据解析为 Unicode 字符串"

    class TimeDeltaParsingError(PydanticErrorBase):
        """
        时间间隔解析错误

        This error is raised when the input value is a string that cannot be parsed for a `timedelta` field:

        Translation:
            当输入值是一个无法被解析为 `timedelta` 字段的字符串时，会引发此错误。

        Examples:
            >>> from datetime import timedelta
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: timedelta
            >>>
            >>> try:
            >>>     Model(x="t")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "time_delta_parsing"

        References:
            - https://errors.pydantic.dev/2.10/v/time_delta_parsing
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#time_delta_parsing
        """

        code = "time_delta_parsing"
        # msg_template = "Input should be a valid timedelta, {error}"  # error 已手动移除
        msg_template = "Input should be a valid timedelta"
        msg_template_zh_cn = "输入应为有效的时间间隔"

    class TimeDeltaTypeError(PydanticErrorBase):
        """
        时间间隔类型错误

        This error is raised when the input value's type is not valid for a `timedelta` field:
        This error is also raised for strict fields when the input value is not an instance of `timedelta`.

        Translation:
            当输入值的类型对于 `timedelta` 字段无效时，会引发此错误。
            当严格字段的输入值不是 `timedelta` 的实例时，同样会引发此错误。

        Examples:
            >>> from datetime import timedelta
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: timedelta
            >>>
            >>> try:
            >>>     Model(x=None)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "time_delta_type"

        References:
            - https://errors.pydantic.dev/2.10/v/time_delta_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#time_delta_type
        """

        code = "time_delta_type"
        msg_template = "Input should be a valid timedelta"
        msg_template_zh_cn = "输入应为有效的时间间隔"

    class TimeParsingError(PydanticErrorBase):
        """
        时间解析错误

        This error is raised when the input value is a string that cannot be parsed for a `time` field:

        Translation:
            当输入值是一个无法被解析为 `time` 字段的字符串时，会引发此错误。

        Examples:
            >>> from datetime import time
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: time
            >>>
            >>> try:
            >>>     Model(x="25:20:30.400")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "time_parsing"

        References:
            - https://errors.pydantic.dev/2.10/v/time_parsing
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#time_parsing
        """

        code = "time_parsing"
        # msg_template = "Input should be in a valid time format, {error}"  # error 已手动移除
        msg_template = "Input should be in a valid time format"
        msg_template_zh_cn = "输入应为有效的时间格式"

    class TimeTypeError(PydanticErrorBase):
        """
        时间类型错误

        This error is raised when the value type is not valid for a `time` field:
        This error is also raised for strict fields when the input value is not an instance of `time`.

        Translation:
            当输入值的类型对于 `time` 字段无效时，会引发此错误。
            当严格字段的输入值不是 `time` 的实例时，同样会引发此错误。

        Examples:
            >>> from datetime import time
            >>>
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: time
            >>>
            >>> try:
            >>>     Model(x=None)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "time_type"

        References:
            - https://errors.pydantic.dev/2.10/v/time_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#time_type
        """

        code = "time_type"
        msg_template = "Input should be a valid time"
        msg_template_zh_cn = "输入应为有效的时间"

    class TimezoneAwareError(PydanticErrorBase):
        """
        时区感知错误

        This error is raised when the `datetime` value provided for a timezone-aware `datetime`
        field doesn't have timezone information:

        Translation:
            当为需要时区信息的 `datetime` 字段提供的 `datetime` 值未包含时区信息时，会引发此错误。

        Examples:
            >>> from datetime import datetime
            >>> from pydantic import AwareDatetime, BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: AwareDatetime
            >>>
            >>> try:
            >>>     Model(x=datetime.now())
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "timezone_aware"

        References:
            - https://errors.pydantic.dev/2.10/v/timezone_aware
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#timezone_aware
        """

        code = "timezone_aware"
        msg_template = "Input should have timezone info"
        msg_template_zh_cn = "输入应包含时区信息"

    class TimezoneNaiveError(PydanticErrorBase):
        """
        无时区信息错误

        This error is raised when the `datetime` value provided for a timezone-naive `datetime` field has timezone info:

        Translation:
            当为不包含时区信息的 `datetime` 字段提供的 `datetime` 值包含时区信息时，会引发此错误。

        Examples:
            >>> from datetime import datetime, timezone
            >>> from pydantic import BaseModel, NaiveDatetime, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: NaiveDatetime
            >>>
            >>> try:
            >>>     Model(x=datetime.now(tz=timezone.utc))
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "timezone_naive"

        References:
            - https://errors.pydantic.dev/2.10/v/timezone_naive
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#timezone_naive
        """

        code = "timezone_naive"
        msg_template = "Input should not have timezone info"
        msg_template_zh_cn = "输入不应包含时区信息"

    class TooLongError(PydanticErrorBase):
        """
        元素过长错误

        This error is raised when the input value's length is greater than the field's `max_length` constraint:

        Translation:
            当输入值的长度超过字段的 `max_length` 约束时，会引发此错误。

        Examples:
            >>> from typing import List
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: List[int] = Field(max_length=3)
            >>>
            >>> try:
            >>>     Model(x=[1, 2, 3, 4])
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "too_long"

        References:
            - https://errors.pydantic.dev/2.10/v/too_long
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#too_long
        """

        code = "too_long"
        # msg_template = "{field_type} should have at most {max_length} items after validation, not {actual_length}"  # TODO: field_type 需要手动映射
        msg_template = "{field_type} should have at most {max_length} items after validation, not {actual_length}"
        msg_template_zh_cn = "{field_type} 最多应有 {max_length} 个元素，而非 {actual_length} 个"

    class TooShortError(PydanticErrorBase):
        """
        元素过短错误

        This error is raised when the value length is less than the field's `min_length` constraint:

        Translation:
            当值的长度小于字段的 `min_length` 约束时，会引发此错误。

        Examples:
            >>> from typing import List
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: ListInt = Field(min_length=3)
            >>>
            >>> try:
            >>>     Model(x=[1, 2])
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "too_short"

        References:
            - https://errors.pydantic.dev/2.10/v/too_short
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#too_short
        """

        code = "too_short"
        # msg_template = "{field_type} should have at least {min_length} items after validation, not {actual_length}"  # TODO: field_type 需要手动映射
        msg_template = "{field_type} should have at least {min_length} items after validation, not {actual_length}"
        msg_template_zh_cn = "{field_type} 至少应有 {min_length} 个元素，而非 {actual_length} 个"

    class TupleTypeError(PydanticErrorBase):
        """
        元组类型错误

        This error is raised when the input value's type is not valid for a `tuple` field:
        This error is also raised for strict fields when the input value is not an instance of `tuple`.

        Translation:
            当输入值的类型对于 `tuple` 字段无效时，会引发此错误。
            当严格字段的输入值不是 `tuple` 的实例时，同样会引发此错误。

        Examples:
            >>> from typing import Tuple
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: Tuple[int]
            >>>
            >>> try:
            >>>     Model(x=None)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "tuple_type"

        References:
            - https://errors.pydantic.dev/2.10/v/tuple_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#tuple_type
        """

        code = "tuple_type"
        msg_template = "Input should be a valid tuple"
        msg_template_zh_cn = "输入应为有效的元组"

    class UnexpectedKeywordArgumentError(PydanticErrorBase):
        """
        意外的关键字参数错误

        This error is raised when you provide a value by keyword for a positional-only argument while calling
        a function decorated with `validate_call`:

        Translation:
            当你在调用使用 `validate_call` 装饰的函数时，为仅位置参数通过关键字方式提供值，会引发此错误。

        Examples:
            >>> from pydantic import ValidationError, validate_call
            >>>
            >>> @validate_call
            >>> def foo(a: int, /):
            >>>     return a
            >>>
            >>> try:
            >>>     foo(a=2)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[1]["type"]))
            "unexpected_keyword_argument"

        References:
            - https://errors.pydantic.dev/2.10/v/unexpected_keyword_argument
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#unexpected_keyword_argument
        """

        code = "unexpected_keyword_argument"
        msg_template = "Unexpected keyword argument"
        msg_template_zh_cn = "出现了意外的关键字参数"

    class UnexpectedPositionalArgumentError(PydanticErrorBase):
        """
        意外的位置参数错误

        This error is raised when you provide a positional value for a keyword-only argument while calling
        a function decorated with `validate_call`:

        Translation:
            当你在调用使用 `validate_call` 装饰的函数时，为仅关键字参数提供位置参数值，会引发此错误。

        Examples:
            >>> from pydantic import ValidationError, validate_call
            >>>
            >>> @validate_call
            >>> def foo(*, a: int):
            >>>     return a
            >>>
            >>> try:
            >>>     foo(2)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[1]["type"]))
            "unexpected_positional_argument"

        References:
            - https://errors.pydantic.dev/2.10/v/unexpected_positional_argument
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#unexpected_positional_argument
        """

        code = "unexpected_positional_argument"
        msg_template = "Unexpected positional argument"
        msg_template_zh_cn = "出现了意外的位置参数"

    class UnionTagInvalidError(PydanticErrorBase):
        """
        联合类型标签无效错误

        This error is raised when the input's discriminator is not one of the expected values:

        Translation:
            当输入的判别器值不在预期值列表中时，会引发此错误。

        Examples:
            >>> from typing import Literal, Union
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class BlackCat(BaseModel):
            >>>     pet_type: Literal["blackcat"]
            >>>
            >>> class WhiteCat(BaseModel):
            >>>     pet_type: Literal["whitecat"]
            >>>
            >>> class Model(BaseModel):
            >>>     cat: Union[BlackCat, WhiteCat] = Field(discriminator="pet_type")
            >>>
            >>> try:
            >>>     Model(cat={"pet_type": "dog"})
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "union_tag_invalid"

        References:
            - https://errors.pydantic.dev/2.10/v/union_tag_invalid
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#union_tag_invalid
        """

        code = "union_tag_invalid"
        msg_template = (
            "Input tag '{tag}' found using '{discriminator}' does not match "
            "any of the expected tags: '{expected_tags}'"
        )
        msg_template_zh_cn = "使用判别器 `{discriminator}` 找到的输入标签 `{tag}` 预期标签 `{expected_tags}` 不匹配"

    class UnionTagNotFoundError(PydanticErrorBase):
        """
        联合类型标签未找到错误

        This error is raised when it is not possible to extract a discriminator value from the input:

        Translation:
            当无法从输入数据中提取判别字段值时，会引发此错误。

        Examples:
            >>> from typing import Literal, Union
            >>> from pydantic import BaseModel, Field, ValidationError
            >>>
            >>> class BlackCat(BaseModel):
            >>>     pet_type: Literal["blackcat"]
            >>>
            >>> class WhiteCat(BaseModel):
            >>>     pet_type: Literal["whitecat"]
            >>>
            >>> class Model(BaseModel):
            >>>     cat: Union[BlackCat, WhiteCat] = Field(discriminator="pet_type")
            >>>
            >>> try:
            >>>     Model(cat={"name": "blackcat"})
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "union_tag_not_found"

        References:
            - https://errors.pydantic.dev/2.10/v/union_tag_not_found
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#union_tag_not_found
        """

        code = "union_tag_not_found"
        msg_template = "Unable to extract tag using discriminator '{discriminator}'"
        msg_template_zh_cn = "无法使用判别字段 '{discriminator}' 提取类型标签"

    class UrlParsingError(PydanticErrorBase):
        """
        URL 解析错误

        This error is raised when the input value cannot be parsed as a URL:

        Translation:
            当输入值无法被解析为合法 URL 时引发此错误。

        Examples:
            >>> from pydantic import AnyUrl, BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: AnyUrl
            >>>
            >>> try:
            >>>     Model(x="test")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "url_parsing"

        References:
            - https://errors.pydantic.dev/2.10/v/url_parsing
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#url_parsing
        """

        code = "url_parsing"
        # msg_template = "Input should be a valid URL, {error}"  # error 已手动移除
        msg_template = "Input should be a valid URL"
        msg_template_zh_cn = "输入应为有效的 URL"

    class UrlSchemeError(PydanticErrorBase):
        """
        URL 协议错误

        This error is raised when the URL scheme is not valid for the URL type of the field:

        Translation:
            当字段要求的URL类型与输入的 URL 协议（scheme）不匹配时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, HttpUrl, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: HttpUrl
            >>>
            >>> try:
            >>>     Model(x="ftp://example.com")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "url_scheme"

        References:
            - https://errors.pydantic.dev/2.10/v/url_scheme
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#url_scheme
        """

        code = "url_scheme"
        msg_template = "URL scheme should be {expected_schemes}"
        msg_template_zh_cn = "URL 协议应为 {expected_schemes}"

    class UrlSyntaxViolationError(PydanticErrorBase):
        """
        URL 语法无效错误

        This error is raised when the URL syntax is not valid:

        Translation:
            当 URL 语法不符合规范时引发此错误。

        Examples:
            >>> from pydantic import BaseModel, Field, HttpUrl, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: HttpUrl = Field(strict=True)
            >>>
            >>> try:
            >>>     Model(x="http:////example.com")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "url_syntax_violation"

        References:
            - https://errors.pydantic.dev/2.10/v/url_syntax_violation
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#url_syntax_violation
        """

        code = "url_syntax_violation"
        # msg_template = "Input violated strict URL syntax rules, {error}"  # error 已手动移除
        msg_template = "Input violated strict URL syntax rules"
        msg_template_zh_cn = "URL 语法错误"

    class UrlTooLongError(PydanticErrorBase):
        """
        URL 长度过长错误

        This error is raised when the URL length is greater than 2083:

        Translation:
            当 URL 长度超过 2083 个字符时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, HttpUrl, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: HttpUrl
            >>>
            >>> try:
            >>>     Model(x="x" * 2084)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "url_too_long"

        References:
            - https://errors.pydantic.dev/2.10/v/url_too_long
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#url_too_long
        """

        code = "url_too_long"
        msg_template = "URL should have at most {max_length} characters"
        msg_template_zh_cn = "URL 最大长度限制为 {max_length} 个字符"

    class UrlTypeError(PydanticErrorBase):
        """
        URL 类型错误

        This error is raised when the input value's type is not valid for a URL field:

        Translation:
            当输入值类型不符合URL字段要求时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, HttpUrl, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     x: HttpUrl
            >>>
            >>> try:
            >>>     Model(x=None)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "url_type"

        References:
            - https://errors.pydantic.dev/2.10/v/url_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#url_type
        """

        code = "url_type"
        msg_template = "URL input should be a string or URL"
        msg_template_zh_cn = "URL 输入应为字符串或 URL 对象"

    class UUIDParsingError(PydanticErrorBase):
        """
        UUID 解析错误

        This error is raised when the input value's type is not valid for a UUID field:

        Translation:
            当输入值的类型不符合 UUID 字段要求时，会引发此错误。

        Examples:
            >>> from uuid import UUID
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     u: UUID
            >>>
            >>> try:
            >>>     Model(u="12345678-124-1234-1234-567812345678")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "uuid_parsing"

        References:
            - https://errors.pydantic.dev/2.10/v/uuid_parsing
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#uuid_parsing
        """

        code = "uuid_parsing"
        # msg_template = "Input should be a valid UUID, {error}"  # error 已手动移除
        msg_template = "Input should be a valid UUID"
        msg_template_zh_cn = "输入应为有效的 UUID 格式"

    class UUIDTypeError(PydanticErrorBase):
        """
        UUID 类型错误

        This error is raised when the input value's type is not valid instance for a UUID field (str, bytes or UUID):

        Translation:
            当输入值的类型不符合UUID字段的要求（应为字符串、字节或UUID对象）时，会引发此错误。

        Examples:
            >>> from uuid import UUID
            >>> from pydantic import BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     u: UUID
            >>>
            >>> try:
            >>>     Model(u=1234567812412341234567812345678)
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "uuid_type"

        References:
            - https://errors.pydantic.dev/2.10/v/uuid_type
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#uuid_type
        """

        code = "uuid_type"
        msg_template = "UUID input should be a string, bytes or UUID object"
        msg_template_zh_cn = "UUID 输入必须是字符串、字节或 UUID 对象"

    class UUIDVersionError(PydanticErrorBase):
        """
        UUID 版本错误

        This error is raised when the input value's type is not match UUID version:

        Translation:
            当输入值的UUID版本不匹配时，会引发此错误。

        Examples:
            >>> from pydantic import UUID5, BaseModel, ValidationError
            >>>
            >>> class Model(BaseModel):
            >>>     u: UUID5
            >>>
            >>> try:
            >>>     Model(u="a6cc5730-2261-11ee-9c43-2eb5a363657c")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "uuid_version"

        References:
            - https://errors.pydantic.dev/2.10/v/uuid_version
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#uuid_version
        """

        code = "uuid_version"
        msg_template = "UUID version {expected_version} expected"
        msg_template_zh_cn = "UUID 版本应为 {expected_version}"

    class ValueError(PydanticErrorBase):
        """
        值错误

        This error is raised when a `ValueError` is raised during validation:

        Translation:
            在校验过程中触发 `ValueError` 时，会引发此错误。

        Examples:
            >>> from pydantic import BaseModel, ValidationError, field_validator
            >>>
            >>> class Model(BaseModel):
            >>>     x: str
            >>>
            >>>     @field_validator("x")
            >>>     @classmethod
            >>>     def repeat_b(cls, v):
            >>>         raise ValueError("自定义的错误内容")
            >>>
            >>> try:
            >>>     Model(x="test")
            >>> except ValidationError as exc:
            >>>     print(repr(exc.errors()[0]["type"]))
            "value_error"

        References:
            - https://errors.pydantic.dev/2.10/v/value_error
            - https://docs.pydantic.dev/2.10/errors/validation_errors/#value_error
        """

        code = "value_error"
        msg_template = "Value error, {error}"
        msg_template_zh_cn = "{error}"  # 不做任何处理，直接抛出用户自定义的错误信息
